/**
 * @author Klaoye
 * @license Apache 2.0 阅读器颜色风格
 */

import com.google.gson.annotations.SerializedName;

import java.awt.*;

public enum ColorStyle {
	/* 别名注解 将字符串反序列为枚举对象 */
	@SerializedName(value = "DARK")
	DARK,
	@SerializedName(value = "WRITE")
	WRITE,
	@SerializedName(value = "GREEN")
	GREEN;

	private static final String[] mode_names = {"黑夜", "白昼", "绿色"};

	public static String getModeName(ColorStyle style) {
		return mode_names[style.ordinal()];
	}

	public static Color[] getStyleColors(ColorStyle style) {
		Color[] colors = new Color[2];
		switch (style) {
			case DARK:
				colors[0] = Color.lightGray;
				colors[1] = Color.black;
				break;
			case WRITE:
				colors[0] = Color.black;
				colors[1] = Color.white;
				break;
			case GREEN:
				colors[0] = new Color(0, 100, 0);
				colors[1] = new Color(204, 232, 207);
				break;
		}
		return colors;
	}

}
